﻿//===============================================================================
// CB Stock Data Library
//===============================================================================
// Copyright © CB.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 
// OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
// WITH THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
//===============================================================================

using System;
using System.Collections.Generic;

namespace CB.Stock.Core
{
    public interface IStockDataService
    {
        bool SupportGetCurrentData { get; }
        bool SupportGetHistoryData { get; }
        /// <summary>
        /// get all the stocks current data
        /// </summary>
        /// <param name="dataTypes">if is null, then return all the supported data types result</param>
        /// <param name="stockInfors">all the stock information</param>
        /// <returns> </returns>
        IEnumerable<Tuple<IStockStaticInformation, IDictionary<StockDataType, IStockDynamicData>>> GetCurrentData(StockDataType[] dataTypes, params IStockStaticInformation[] stockInfors);
        
        /// <summary>
        /// return all available data between the start date and end date
        /// </summary>
        /// <param name="stockInfo"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        /// <remarks>
        /// please be noticed the date of the first data is not equal to the startDate, 
        /// because maybe you specified a night time while the stock market opens at day time
        /// </remarks>
        IEnumerable<IDictionary<StockDataType, IStockDynamicData>> GetHistoryData(IStockStaticInformation stockInfo,
            DateTime startDate, DateTime endDate);
    }
}
